<?php

namespace frontend\modules\yii\assets\markdown;

use yii\web\AssetBundle;
use yii\web\AssetManager;
use yii\web\View;

/**
 * http://editor.md.ipandao.com/
 * https://gitee.com/pandao/editor.md
 */
class MarkdownAsset extends AssetBundle
{
    public $sourcePath = '@frontend/modules/yii/assets/markdown';
    public $css = [
        'css/editormd.css',
    ];
    public $js = [
        'js/editormd.min.js'
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
    ];

//    public function initMarkdown(){
//
//        $js = <<<JS
//    var editor = editormd("editor", {
//        width: "100%",
//        height: "100%",
//        // markdown: "xxxx",     // dynamic set Markdown text
//        path : "{$this->baseUrl}/lib/"  // Autoload modules mode, codemirror, marked... dependents libs path
//    });
//JS;
//        \Yii::$app->view->registerJs($js, View::POS_READY);
//
//    }

}
